#ifndef PARAMADD_H
#define PARAMADD_H

#include <QWidget>
#include <QPaintEvent>
#include <QPainter>
#include "blldataflow.h"
#include "sqlhelper.h"

namespace Ui {
class ParamAdd;
}

class ParamAdd : public QWidget
{
    Q_OBJECT

public:
    explicit ParamAdd(QWidget *parent = nullptr);
    ~ParamAdd();
    void clearInput();

private slots:
    void on_btnClose_clicked();
    void on_btnCancel_clicked();
    void on_btnConfirm_clicked();
    void on_btnIsOn_toggled(bool checked);

    void on_lineName_returnPressed();
    void on_lineCode_returnPressed();

    void onSpinBoxReturnPressed();
    void onUpdateParamTimes();
    void onUpdateParamInterval();

    void retranslateUiSlot();

private:
    void initWidget();
    void connectSignals();
    void disconnectSignals();
    void autoFocusOn();

protected:
    void paintEvent(QPaintEvent *);
    void showEvent(QShowEvent *);

private:
    Ui::ParamAdd *ui;
    BllDataFlow * bdf;
    SqlHelper * sqlHelper;
    Parameter param;
};

#endif // PARAMADD_H
